<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('彩票支付订单列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 120px;">商户编号：</label>
                                <input type="text" name="mer_no"/>
                            </li>
                            <li>
                                <label style="width: 120px;">流水号：</label>
                                <input type="text" name="serial"/>
                            </li>
                            <li>
                                <label style="width: 120px;">卡号：</label>
                                <input type="text" name="pan"/>
                            </li>
                            <li>
                                <label style="width: 120px;">代理商编号：</label>
                                <input type="text" name="agent_no"/>
                            </li>
                            <li>
                                <label style="width: 120px;">终端号：</label>
                                <input type="text" name="posno"/>
                            </li>
                            <li>
                                <label style="width: 120px;">卡类型:</label>
                                <select name="cardtype">
                                    <option value="">全部</option>
                                    <option value="0">准贷记卡</option>
                                    <option value="1">借记卡</option>
                                    <option value="2">贷记卡</option>
                                    <option value="3">预付费卡</option>
                                </select>
                            </li>
                            <li>
                                <label style="width: 120px;">清算类型:</label>
                                <select name="sett_type">
                                    <option value="">全部</option>
                                    <option value="0">S0</option>
                                    <option value="1">D1</option>
                                </select>
                            </li>
                            <li>
                                <label style="width: 120px;">交易状态:</label>
                                <select name="status">
                                    <option value="">全部</option>
                                    <option value="0">成功</option>
                                    <option value="2">失败</option>
                                    <option value="-1">撤销　</option>
                                    <option value="-2">冲正</option>
                                    <option value="1">补录</option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label style="width: 120px;">交易日期：</label>
                                <input type="text" name="startlocaldate"  class="time-input" />
                                <span>-</span>
                                <input type="text" name="endlocaldate"  class="time-input"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

           <!-- <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="lotteryPaymentOrder:lotteryPaymentOrder:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="lotteryPaymentOrder:lotteryPaymentOrder:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="lotteryPaymentOrder:lotteryPaymentOrder:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="lotteryPaymentOrder:lotteryPaymentOrder:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>-->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('lotteryPaymentOrder:lotteryPaymentOrder:edit')}]];
        var removeFlag = [[${@permission.hasPermi('lotteryPaymentOrder:lotteryPaymentOrder:remove')}]];
        var prefix = ctx + "lotteryPaymentOrder/lotteryPaymentOrder";

        $(function() {
            var options = {
                url: prefix + "/getBankExList",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "彩票支付订单",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'SERIAL',
                    title: '流水号',
                },
                {
                    field: 'MER_NO',
                    title: '商户编号'
                },
                {
                    field: 'MER_NAME',
                    title: '商户名称'
                },
                {
                    field: 'SCREEN_NAME',
                    title: '结算人'
                },
                {
                    field: 'MSGTYPE',
                    title: '交易类型',
                    formatter(value,row,index){
                        if(value =='H007') {
                            return "消费"
                        } else if (value =='H900'){
                            return "参数下载"
                        } else if (value =='H000'){
                            return "签到"
                        } else if (value =='H901'){
                            return "公钥下载"
                        } else if (value =='H902'){
                            return "主密钥交换、下载"
                        } else if (value =='H903'){
                            return "IC公钥、参数查询"
                        } else if (value =='H904'){
                            return "IC公钥、参数下载"
                        } else if (value =='H002'){
                            return "余额查询"
                        } else if (value =='H014'){
                            return "退货"
                        } else if (value =='H013'){
                            return "冲正"
                        } else if (value =='H905'){
                            return "应用版本更新查询"
                        } else if (value =='H906'){
                            return "电子签名数据上送"
                        } else if (value =='C007'){
                            return "购彩"
                        } else if (value =='S007'){
                            return "SIM卡年费"
                        }
                    }
                },
                {
                    field: 'TERNO',
                    title: '终端号'
                },
                {
                    field: 'LOCALDATE',
                    title: '交易时间',
                    formatter(value,row,index){
                        return value +" "+row.LOCALTIME;
                    }
                },
                {
                    field: 'PAN',
                    title: '交易卡号'
                },
                {
                    field: 'BANK_NAME',
                    title: '发卡行'
                },
                {
                    field: 'AMOUNT',
                    title: '交易金额',
                    formatter: function (value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'STATUS',
                    title: '交易状态',
                    formatter(value,row,index) {
                        if (value == '0') {
                            return '<span style="color:green;">成功</span>';
                        } else if (value == '2') {
                            return '<span style="color:red;">失败</span>';
                        } else if (value == '20') {
                            return '<span style="color:red;">待撤销</span>';
                        } else if (value == '-1') {
                            return '<span style="color:red;">撤销</span>';
                        } else if (value == '-2') {
                            return '<span style="color:red;">冲正</span>';
                        } else if (value == '50') {
                            return '<span style="color:red;">待冲正</span>';
                        } else if (value == '1') {
                            return '<span style="color:blue;">补录</span>';
                        }
                    }
                },
                {
                    field: 'CARDTYPE',
                    title: '卡类型',
                    formatter(value,row,index) {
                        if (value == '0') {
                            return '<span style="color:green;">未知</span>';
                        } else if (value == '1') {
                            return '<span style="color:red;">借记卡</span>';
                        } else if (value == '2') {
                            return '<span style="color:red;">贷记卡</span>';
                        } else if (value == '3') {
                            return '<span style="color:red;">预付费卡</span>';
                        } else {
                            return '<span style="color:red;">未知</span>';
                        }
                    }
                },
                {
                    field: 'SETT_TYPE',
                    title: '结算类型',
                    formatter(value,row,index){
                        if (value == '0'){
                            return "<span style='color: red'>D0</span>";
                        } else if (value == '1'){
                            return "<span style='color: green'>T1</span>";
                        } else {
                            return "<span>未知</span>";
                        }
                    }
                },
                {
                    field: 'AU_STATE',
                    title: '结算状态',
                    formatter(value,row,index){
                        if (value == '0'){
                            return "<span style='color: red'>未清算</span>";
                        } else if (value == '1'){
                            return "<span style='color: green'>已清算</span>";
                        } else {
                            return "<span>未知</span>";
                        }
                    }
                },
                {
                    field: 'RC',
                    title: '返回码'
                },
                {
                    field: 'RRNO',
                    title: '参考号'
                },
                {
                    field: 'BID',
                    title: '通道号'
                },
                {
                    field: 'AIR',
                    title: '授权号'
                },
                {
                    field: 'ISYSF',
                    title: '是否云闪付优惠',
                    formatter(value,row,index){
                        if (value == '0'){
                            return "<span style='color: red'>普通交易</span>";
                        } else if (value == '1'){
                            return "<span style='color: green'>云闪付交易</span>";
                        } else {
                            return "<span>未知</span>";
                        }
                    }
                },
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>